<!DOCTYPE html>
<html>
<head>
<title>提现管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<#include "../../../../include/resources.html">
<script type="text/javascript">
	$.canEdit = false;
</script>
<script type="text/javascript">
	$.canDelete = false;
</script>
<script type="text/javascript">
	$.canAdd = false;
</script>
<script type="text/javascript">
	$.canGrant = false;
</script>
<script type="text/javascript">
	var dataGrid;
	var winWidth =  800;
	var winHeight = 280;
	
	 var cancelCashUrl = "/modules/account/cash/accountcash/cancelCash.html"
     var cancelCashParmeters = "'{0}','" + cancelCashUrl+"'";
     
     var verifyCashUrl = "/modules/account/cash/accountcash/verifyCash.html"
     var verifyCashParmeters = "'{0}','" + verifyCashUrl+"'";
	
	var kfVerifyTitle="提现管理";
	var kfVerifyUrl="/modules/account/cash/accountcash/accountCashList.html";
	var kfVerifyWinParmeters = "'{0}','"+kfVerifyTitle+"',800,600,'"+kfVerifyUrl+"','确定'";
	$(function() {
		dataGrid = $('#dataGrid').datagrid({
			url : 'verifyAccountCashList.html',
			fit : true,
			fitColumns : true,
			border : false,
			pagination : true,
			idField : 'id',
			pageSize : pageSize,
			pageNums :1,
			pageList : pageList,
			sortName : 'id',
			sortOrder : 'desc',
			checkOnSelect : false,
			selectOnCheck : false,
			nowrap : false,
			singleSelect:true,
			columns : [[		
				{ field: 'id', title: '编号', width: 50,fixed: true,sortable:true},
				{ field: 'userName', title: '用户名', width: 60},
				{ field: 'realName', title: '真实姓名', width: 80},
				{ field: 'bankNo', title: '银行卡尾号', width: 70},
				{ field: 'bank', title: '所属银行', width: 60},
				{ field: 'money', title: '提现总额(元)', width: 60,formatter:function(value, row, index){
					return value;
				}},
				{ field: 'credited', title: '到账金额(元)', width: 60,formatter:function(value, row, index){
					return value;
				}},
				{ field: 'fee', title: '手续费(元)', width: 60,formatter:function(value, row, index){
					return value;
				}},
				{ field: 'cashFeeBear', title: '手续费承担方', width: 100,formatter:function(value, row, index){
					if(value==1){
						return '平台垫付';
					}else if(value==2){
						return '个人承担';
					}else{
						return '';
					}
				}},
				{ field: 'addTime', title: '提现时间', width: 130,
					formatter: function(value,row,index){
						if (value){
							return getLocalTime(value,4);
						} else {
							return "";
						}
					}
				},
				{ field: 'status', title: '状态', width: 100,formatter:function(value, row, index){
						switch(value){
						case 0:return "申请提现";
						case 1:return "提现成功";
						case 2:return "提现失败";
						case 4:return "用户取消提现";
						}
					}
				},
				{ field : 'action',
	                title : '操作',
	                width :75,
	                fixed:true,
	                formatter : function(value, row, index) {
	                    var str = '';
	                    if(row.status == 0){
		                    str += $.formatString('<img onclick="$.fn.dataGridOptions.verifyCashFun('+verifyCashParmeters+');" src="{1}" title="提现确认"/>', row.id, '${theme_dir}/css/images/extjs_icons/arrow/accept.png');
		                    str += '&nbsp;'; 
		                    str += $.formatString('<img onclick="$.fn.dataGridOptions.cancelCashFun('+cancelCashParmeters+');" src="{1}" title="提现取消"/>', row.id, '${theme_dir}/css/images/extjs_icons/cancel.png');
		                    str += '&nbsp;';
	                    }
	                    return str;
	                }
				}
			 ]],
	        toolbar : '#toolbar'
		});
	});
	function exportExcel(){
		var url = "/modules/account/cash/accountcash/exportExcelAccountCash.html";
		var userName = $("#userName").val();
		var status = $("#status").val();
		var startTime = $("#startTime").val();
		var endTime = $("#endTime").val();
		var sou = "?userName=" + userName + "&status=" + status + "&startTime=" + startTime + "&endTime=" + endTime;
		window.location.href = url + sou;
	}
	
</script>
</head>
<body style="padding:0 20px;" >
	<div class="easyui-layout" data-options="fit : true,border : false">
		<div data-options="region:'north',border:false,collapsible:false" id="searchBox">
            <div class="sLeft">
	            <form id="searchForm">
	            	<input type="text"  name="searchName" class="sInput" placeholder="输入用户名进行搜索" /><a href="javascript:;" title="查询" class="sBtn" onclick="$.fn.dataGridOptions.searchFun('#searchForm');">查询</a><a href="javascript:;" class="advBtn" title="条件查询">条件查询 <i class="iconfont">&#xe638;</i></a>
                                    <a href="javascript:void(0);" class="reloadIcon" onclick="dataGrid.datagrid('reload');" title="刷新" ><i class="iconfont">&#xe603;</i></a>
	            </form>
            </div>
            <div class="sRight">
            	<a id="a" onclick="exportExcel();" href="javascript:void(0);" class="addBtn">导出excel</a>	
            </div>
            <form id="showAdw">
		        <ul class="showAdw" style="display:none;">
		        	<a href="javascript:void(0);"><i class="iconfont closeWin">&#xe63a;</i></a>
		        	<li><span>用户名</span><input type="text" name="userName" id="userName"  autocomplete="off"/></li>
		        	<li><span>状态</span><select name="status" id="status" class="type">
						<option value=0 selected="selected">申请提现</option>
						<option value=1>提现成功</option>
						<option value=2>提现失败</option>
					</select></li>
		       		<li><span>时间</span><input type="text" name="startTime" id="startTime" onFocus="WdatePicker({maxDate:'#F{$dp.$D(\'endTime\')}',readOnly:true})" class="searchTime"/>&nbsp;-&nbsp;<input type="text" name="endTime" id="endTime" onFocus="WdatePicker({minDate:'#F{$dp.$D(\'startTime\')}',readOnly:true})" class="searchTime"/></li>
		       		<li><span>&nbsp;</span><a href="javascript:void(0);" class="searchBtn sureBtn" onclick="$.fn.dataGridOptions.searchFun('#showAdw');">确定</a><a href="javascript:void(0);" class="searchBtn" onclick="$.fn.dataGridOptions.cleanFun('#searchForm');">重置</a></li>
		        </ul>
	        </form>
        </div>
		<div data-options="region:'center'" style="margin-top:30px;padding-bottom:30px;">
			<table id="dataGrid"></table>
		</div>
	</div>
</body>
</html>
<script src="${theme_dir}/js/search.js"></script>